home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-13 | 9.2 KB | 188 lines | [ttro/ttxt] |
- Director 4.04 for Macintosh
- November 1994
-
- LINGO ISSUES
-
- The searchPath is a function that can be both tested and set. The searchPath is
- a regular list, so you can append, add, addAt, deleteAt, or setAt just like with
- other lists. For example:
- Windows: set the searchPath to ["c:\myDrive\myDirect\", "d:\myCDROM\aDirect\"]
- Macintosh: set the searchPath to [ "myDrive:myFolder:", "myCDROM:aFolder:"]
- Trailing colons and backslashes are allowed but not necessary. The examples
- look like this if you leave out the trailing colons and backslashes:
- Windows: set the searchPath to ["c:\myDrive\myDirect", "d:\myCDROM\aDirect"]
- Macintosh: set the searchPath to [ "myDrive:myFolder", "myCROM:aFolder"]
-
- When creating cursors from cast members, you can now use bitmapped cast
- members smaller than 16x16. When using a bitmap larger than 16x16, the top
- left portion of the cast member is used for the cursor. The registration point is
- now properly used as the hot spot of the cursor.
-
- When creating a movie-in-a-window, set the windowType to 49 for a floating
- palette windoid. Other windowType values are possible, but experiment with
- caution as some modal windows can be exited only by restarting your
- computer.
-
- The function getNthFileNameInFolder() will find files with the "invisible"
- bit set. Director movie files must be visible.
-
- "When timeout" doesn't function while Lingo is in a repeat loop, even
- though "the timeoutLapsed" returns the proper value if inside that loop. This
- is because Lingo repeat loops are optimized for fastest processing, and in
- doing so will defer outside events. Use a "go to the frame" score loop,
- incrementing a counter each time.
-
- When you branch to another movie using Director 4.0, the contents of the
- actorList are not cleared, even after using clearGlobals. Consequently, you
- may find unpredictable behavior between scripts in the new movie_sprites
- may move around and so on. So when starting the next movie, set the
- actorList to an empty list by using the statement:
- set the actorList = []
-
- Writing parent scripts within score or cast member scripts will keep these
- handlers private to objects that are birthed from these scripts. If a movie script
- is used to hold a parent script instead, then these handlers would be accessible
- to anything in the movie that calls that handler, which is generally not
- desired. It is best to use score scripts to hold parent scripts.
-
- The ancestor property of an object can be changed on the fly. This allows you
- to radically change behaviors and properties with a single command.
-
- Factories are included only for backward-compatibility with pre-existing
- projects. If you need to edit them in Director 4.0, use the Recompile All
- Scripts menu command to ensure that your edited factories compile fully.
- Generally, converting your object-oriented code to parent scripts will give
- more power and reliability.
-
- Lists can most quickly be initialized by putting them right into a handler that
- is called at startup. Or, if a text field contains a bracketed list, you can use the
- Lingo:
- set myList = value (field "myfield")
-
- To update changes to the regPoint of a cast member, or to update changes to
- an image after relinking with the fileName property, use "set the picture of
- myCast = the picture of myCast".
-
- Doing a rollOver or cursor of sprite operation on a sprite that has been
- removed will reflect that channel's last position on stage. Either refrain from
- testing rollovers on sprites that are not there or set the final position for that
- sprite up above the menu bar before deleting it, so that the channel's score
- information is changed.
-
- Sending messages: A mouseUp message can be sent to a button named
- "myButton" by:
- mouseUp (script "myButton")
- You can send any message to any script that can handle that message using
- this technique. Cast member scripts can also have private properties, which
- are local variables that persist across time, as in:
- property numberOfClicks
- on mouseUp
- if the numberOfClicks of (script "myButton") >2 then
- go to frame "try again"
- end if
- end mouseUp
-
- If play commands are issued and matching play done commands are not,
- memory will be used up since the calling script won't get deleted. It's safer to
- avoid play commands if you can't guarantee that matching play done
- commands will eventually be issued. Use a global list to remember what
- movie to return to instead.
-
- The play movie command is not fully supported from inside a tell command.
- Instead, when play movie is issued from inside a tell command, it will be
- treated like a go command.
-
- Using uninitialized local variables within a do command triggers a compile
- error in Lingo. So you must initialize all local variables that you intend to use
- before the do command. If you will not know the names of your variables
- until runtime, then you can access them from a known global property list.
-
- The searchPaths global property (not a function) is a list of paths that Director
- searches. Each item in the list is a fully qualified pathname of directories as
- they appear on the current platform at run time. To add items to the list, use
- the add or addAt commands. To delete items from the list, use the delete or
- deleteAt commands. For example, imagine you want to tell Director to look for
- files inside a directory called Sounds, which is located in the same directory as
- the current Director movie. You'd execute the following lines of Lingo in order to
- add the Sounds directory to the searchPaths:
- put the moviePath & "Sounds" into soundsPath
- add the searchPaths, soundsPath
-
- Setting very many paths into the searchPath property slows searches. To
- speed searching, limit this list.
-
- When movies are protected or made into projectors, they lose their scriptText
- property, so this can no longer be read, although it can still be set.
-
-
- LINGO DICTIONARY CORRECTIONS
-
- The syntax for importFileInto is incorrectly listed in the Lingo Dictionary. The
- correct syntax is:
- importFileInto cast "castname", "filename"
- where "castname" is the original cast member's name and "filename" is the
- new cast member (imported file) name.
-
- The pictureP (picture predicate) function does not work directly on a cast
- member as described in the Lingo Dictionary, but actually on the picture
- property of a cast member. If you set "temp = the picture of cast 1", then
- pictureP(temp) will evaluate to TRUE.
-
- The Lingo Dictionary says that the preload of cast n determines whether the
- digital video cast member has been preloaded into memory. It should say that
- it determines whether the digital video cast member is able to preload into
- memory. Setting preload to 1 is the same as checking the Enable Preload to
- RAM checkbox in the Digital Video Cast Member Info dialog box.
-
- The Lingo command deleteOne was omitted from the Lingo Dictionary. This
- command deletes a value from a linear or property list. Its correct syntax is
- deleteOne aList, aValue. For example:
- set x = [ 10, 3, 40 ]
- deleteOne x, 3
- put x --> [ 10, 40 ]
- set p = [ name: "JT", age: 0 ]
- deleteOne p, 0
- put p --> [ name: "JT" ]
-
- The stepFrame handler is found in the Lingo Dictionary within the definition
- for the actorList property, as this is the only time that a stepFrame handler
- would be used. It is best not to delete an object from the actorList within the
- object's stepFrame handler or handlers called by the object's stepFrame
- handler. If the contents of the actorList change while the actorList is still being
- evaluated, an error can result. Instead, if you need to delete an object
- depending on the results of a stepFrame operation, add this object into a
- separate global list whose contents can then be evaluated and removed from
- the actorList during a separate exitFrame or other handler.
-
- Property list strings are in fact case sensitive.
-
- How Lingo unload/preload/loaded applies to cast member types
- In most cases, cast members must be loaded into memory when they are in
- use and can be unloaded afterwards. Starting with Director 4.0.4, preloading a
- film loop will preload cast members used in the film loop. The Lingo
- construct "the loaded of cast" tells whether a cast member is currently loaded.
- Exceptions to this rule are indicated with an asterisk (*) in the following table:
-
- Type Loaded Loaded by Always Unloaded by
- when used PRELOAD loaded UNLOAD
- bitmap yes yes no yes
- film loop yes yes no yes
- text yes yes no yes
- palette yes yes no yes
- PICT yes yes no yes
- sound yes yes no yes
- button yes yes no yes
- shape no* no* yes* no*
- movie yes* yes* no* no*
- digital video no* yes* no* yes*
- script no* no* yes* no*
-
- What this means:
- - Shape and script cast members are always loaded.
- - Movie cast members are never unloaded.
- - Digital video cast members can be preloaded and unloaded, but this is
- independent of whether or not they are being used. A loaded digital video
- cast member is faster than one that is not loaded.
-
-
-